package com.nsn.das.midas.model.mml.data;

import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.nsn.das.midas.model.component.Build;
import com.nsn.das.midas.model.component.Layer;
import com.nsn.das.midas.model.component.RevisionHistory;
import com.nsn.das.midas.model.embedded.State;
import com.nsn.das.midas.model.embedded.Status;
import com.nsn.das.midas.model.embedded.Version;
import com.nsn.das.midas.model.mml.letter.MMLGroupLetter;
import com.nsn.das.midas.model.user.DASUser;

@Entity
@Table(name = "mml_group_data")
public class MMLGroupData extends MMLData{
	private State state;//GDState
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="group_letter_id")
	private MMLGroupLetter groupLetter;//GDGroup->GDClass
	
	private Date acceptedDate;//GDAcceptedDate
	private String MMLName;//GDMMLID
	private boolean grammarChecked;//_Grammar
	private String groupType;//GDGType
	private String menuText;//GDEnMenuText
	@Column(columnDefinition="TEXT")
	private String programFunction;//GDProgFunc
	@ManyToMany(fetch=FetchType.LAZY)
	private Set<Layer> layers;//GDLayer
	@ManyToMany(fetch=FetchType.LAZY)
	private Set<Build> builds;//GDPackage,GDRelease
	@Embedded
	private Status status;//GDStatus
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="author_id")
	private DASUser author;//GDAuthor,GDEmail
	private Date createdAt;//GDDate
	@Embedded
	private Version version;//GDVersion
	@OneToMany(fetch=FetchType.LAZY)
	private List<RevisionHistory> histories;//Comments,RevisionHistory
	@OneToMany(fetch=FetchType.LAZY)
	private List<MMLCommandData> commandDatas;
	
	public List<MMLCommandData> getCommandDatas() {
		return commandDatas;
	}
	
	public void setCommandDatas(List<MMLCommandData> commandDatas) {
		this.commandDatas = commandDatas;
	}

	public State getState() {
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}

	public MMLGroupLetter getGroupLetter() {
		return groupLetter;
	}

	public void setGroupLetter(MMLGroupLetter groupLetter) {
		this.groupLetter = groupLetter;
	}

	public Date getAcceptedDate() {
		return acceptedDate;
	}

	public void setAcceptedDate(Date acceptedDate) {
		this.acceptedDate = acceptedDate;
	}

	public String getMMLName() {
		return MMLName;
	}

	public void setMMLName(String mMLName) {
		MMLName = mMLName;
	}

	public boolean isGrammarChecked() {
		return grammarChecked;
	}

	public void setGrammarChecked(boolean grammarChecked) {
		this.grammarChecked = grammarChecked;
	}

	public String getGroupType() {
		return groupType;
	}

	public void setGroupType(String groupType) {
		this.groupType = groupType;
	}

	public String getMenuText() {
		return menuText;
	}

	public void setMenuText(String menuText) {
		this.menuText = menuText;
	}

	public String getProgramFunction() {
		return programFunction;
	}

	public void setProgramFunction(String programFunction) {
		this.programFunction = programFunction;
	}

	public Set<Layer> getLayers() {
		return layers;
	}
	public void setLayers(Set<Layer> layers) {
		this.layers = layers;
	}

	public Set<Build> getBuilds() {
		return builds;
	}

	public void setBuilds(Set<Build> builds) {
		this.builds = builds;
	}

	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

	public DASUser getAuthor() {
		return author;
	}

	public void setAuthor(DASUser author) {
		this.author = author;
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	public Version getVersion() {
		return version;
	}

	public void setVersion(Version version) {
		this.version = version;
	}

	public List<RevisionHistory> getHistories() {
		return histories;
	}

	public void setHistories(List<RevisionHistory> histories) {
		this.histories = histories;
	}
	
}
